<template>
  <view class="setting">

    <view class="basic-flex-sb item" v-for="(item,index) in settingList" :key="index"
          @click="$utils.jumpPage(`${item.to}`)">
      <view class="title">{{ item.title }}</view>
      <uni-icons type="right" color="#B5B5B5" size="20"></uni-icons>
    </view>

    <button class="basic-flex-sb item" open-type="contact"
            bindcontact="handleContact">
      <view class="title">在线客服</view>
      <uni-icons type="right" color="#B5B5B5" size="20"></uni-icons>
    </button>

    <view class="base-bottom base-btn" @click="signOut">退出登录</view>
  </view>
</template>

<script>

export default {

  data() {
    return {
      settingList: [
        {
          title: '用户协议',
          to: '/pages_other/rich_text?type=2',
        },
        {
          title: '隐私协议',
          to: '/pages_other/rich_text?type=3',
        },
        {
          title: '关于我们',
          to: '/pages_other/rich_text?type=1',
        },
        {
          title: '意见反馈',
          to: '/pages_other/rich_text?type=1',
        },
        {
          title: '收货地址',
          to: '/pages_my/address',
        },
      ],
    }
  },
  onLoad() {
  },
  computed: {},
  methods: {
    signOut() {
      this.$tip('是否退出登录', 'ask', () => {
        this.$store.dispatch('auth/LOGOUT')
      })
    },
  },
}
</script>
<style>
page {
  background: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.setting {
  padding: 0px 15px;

  & > .item {
    padding: 15px 0px;
    line-height: 25px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #F6F6F6;
    border-radius: 0px;

    & > .title {
      font-weight: 500;
      font-size: 14px;
      color: #171D34;
    }

    &:after {
      border: none;
    }

  }
}
</style>
